function do_maps(s_cfg, s_cds, s_at, s_us)
%function do_maps(s_cfg, s_cds, s_at, s_us)
%
%Plots maps per instant and per layer
    siz = size(s_us);
    ninstants = siz(1);
    nlayers = siz(2);
    
    for n = 1 : ninstants
    for k = 1 : nlayers
        
        if s_us(n,k).layer > 0           
            layer = s_us(n,k).layer;
            if s_us(n,k).instant > 0
                bl_corner = [...
                            s_us(n,k).instant ...
                            s_us(n,k).layer ...
                            s_us(n,k).xrange(1) ...
                            s_us(n,k).yrange(1) ...
                            ]; % bl_corner (tzxy)
                tr_corner = [...
                            s_us(n,k).instant ...
                            s_us(n,k).layer ...
                            s_us(n,k).xrange(2) ...
                            s_us(n,k).yrange(2) ...
                            ]; %tr_corner (tzxy)
            else
                bl_corner = [layer ...
                            s_us(n,k).xrange(1) ...
                            s_us(n,k).yrange(1) ...
                            ]; %tr_corner (tzxy)
                tr_corner = [layer ...
                            s_us(n,k).xrange(2) ...
                            s_us(n,k).yrange(2) ...
                            ]; %tr_corner (tzxy)
            end
        else
            layer = length(s_cds.zsize);
            if s_us(n,k).instant > 0
                bl_corner = [s_us(n,k).instant ...
                            s_us(n,k).xrange(1) ...
                            s_us(n,k).yrange(1) ...
                            ]; %tr_corner (tzxy)
                tr_corner = [s_us(n,k).instant ...
                            s_us(n,k).xrange(2) ...
                            s_us(n,k).yrange(2) ...
                            ]; %tr_corner (tzxy)
            else
                bl_corner = [...
                            s_us(n,k).xrange(1) ...
                            s_us(n,k).yrange(1) ...
                            ]; %tr_corner (tzxy)
                tr_corner = [...
                            s_us(n,k).xrange(2) ...
                            s_us(n,k).yrange(2) ...
                            ]; %tr_corner (tzxy)
            end
        end
        m_bl_corner = [layer s_us(n,k).xrange(1) s_us(n,k).yrange(1)]; %z x y
        m_tr_corner = [layer s_us(n,k).xrange(2) s_us(n,k).yrange(2)];
        
        list = get_vars(s_cfg, s_cds, s_at, s_us(n,k), ...
                          bl_corner, tr_corner, m_bl_corner, m_tr_corner);
        s_plot = do_map( list, s_cfg, s_cds, s_at, s_us(n,k));
        do_plot(s_cfg, s_at, s_plot);
                
    end
    end